<template>
  <div class="info">
    <el-tabs v-model="activeName">
      <el-tab-pane label="积分设置" name="1">
        <setting-intrgral v-if="activeName === '1'" @isUnable="checkIsUsable"/>
      </el-tab-pane>
      <!--<el-tab-pane :disabled="disable" label="积分账户" name="2">-->
        <!--<account v-if="activeName === '2'"/>-->
      <!--</el-tab-pane>-->
      <!--<el-tab-pane :disabled="disable" label="操作日志" name="3">-->
        <!--<integralinfo v-if="activeName === '3'"/>-->
      <!--</el-tab-pane>-->
    </el-tabs>
  </div>
</template>

<script>
  import Account from './components/integral/account'
  // import Integralinfo from './components/integral/integralinfo'
  import SettingIntrgral from './components/integral/setting'

  export default {
    components: {
      Account,
      // Integralinfo,
      SettingIntrgral
    },
    data() {
      return {
        activeName: '1',
        ruleForm: {},
        disable: false
      }
    },
    methods: {
      checkIsUsable(val) {
        if (!val.isUsable) {
          this.$message.error('积分没有开启,开启后才能使用相关功能！')
        }
        this.disable = !val.isUsable
      }
    }
  }
</script>

<style lang="scss" scoped>
  .info {
    padding: 0 20px;

    .addprogram {
      width: 100%;
      padding: 20px 0;

      .el-button {
        float: right;
      }
    }
  }
</style>
